package me.jessyan.mvparms.demo.mvp.ui.view;

import android.app.Activity;
import android.content.Context;
import android.view.Gravity;
import android.view.LayoutInflater;
import android.view.View;
import android.view.WindowManager;
import android.widget.LinearLayout;
import android.widget.PopupWindow;

import com.jess.arms.mvp.BasePresenter;

import me.jessyan.mvparms.demo.mvp.presenter.UserPresenter;


/**
 * The author: Zhao X.H.
 * Creation time: 2018/2/14 ${time}
 */

public class StatusView<T>  {
    private Context mContext;
    private BasePresenter mPresenter;
    private String token;
    public StatusView(Context context, View mContent, String token, UserPresenter mPresenter) {
//        this.mPresenter = mPresenter;
//        this.token = token;
        init();
    }

    public StatusView(Context context, View mContent, String token) {
        this.mContext = context;
        this.token = token;
        init();
    }

    private void init() {


    }

    public void showPopWindowByCenter(View v){

    }


    /**
     * 设置添加屏幕的背景透明度
     *
     * @param bgAlpha
     *            屏幕透明度0.0-1.0 1表示完全不透明
     */
    public void setBackgroundAlpha(float bgAlpha) {
        WindowManager.LayoutParams lp = ((Activity) mContext).getWindow()
                .getAttributes();
        lp.alpha = bgAlpha;
        ((Activity) mContext).getWindow().setAttributes(lp);

    }

    public interface updateApkListener{
        void downloadApk(String url);
    }
}
